package com.meepo.basic.components

import android.content.Context
import android.widget.ImageView
import com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions
import com.meepo.framework.design.helper.ImageLoader
import com.meepo.framework.design.recycler.ViewHolder

object ImageLoaderFactory {
    fun getImageLoader(context: Context, duration: Int = 0): ViewHolder.ImageLoader {
        return object : ViewHolder.ImageLoader {
            override fun loadImage(iv: ImageView, path: String) {
                ImageLoader.loadImage(context, path, iv, transitionOptions = DrawableTransitionOptions().crossFade(duration))
            }
        }

    }
}